home *** CD-ROM | disk | FTP | other *** search
- /*
- * $VER: 1.00 (2-mar-1995)
- *
- * Arexx program for Visual to generate thumbnails with ImageFX.
- * Written by C.Vallee
- *
- * This script generates thumbnails for all the selected file
- *
- */
-
- options results
- gfxport = IMAGEFX.1
-
- /* Loading ImageFX, if not present */
-
- if (~show('p',gfxport)) then do
- message "Loading ImageFX..."
- address command "run ImageFX:ImageFX Iconify"
- message "Waiting for the "||gfxport||" ARexx port..."
-
- /* Waiting for the ARexx port every 2 seconds until present */
- do while (~show('p','IMAGEFX.1'))
- address command "Wait 2"
- check
- if rc ~= 0 then exit
- end
- end
-
- GetInfo
- parse var result '"' mypalette '"' w h .
-
- address value gfxport
-
- Redraw Off
- Undo Off
-
- Render Mode Hires Lace Ham
- Render Colors 64
-
- LockRange 0 Off
- Palette 8
- LoadPalette '"'mypalette'"' '-1'
- LockRange 0 On
-
- address
-
- do forever
- check
- if rc ~= 0 then break
-
- getselected
- if result = "" then break
- file = result
-
- i = LASTPOS('/', file)
- IF i = 0 THEN i = LASTPOS(':', file)
- name = substr( file , i+1 )
-
- message 'Loading "'||name||'"...'
-
- address
- LoadBuffer '"'file'"' Force NoSmooth
-
- if rc = 0 then do
- GetMain
- parse var result . width height .
-
- if ( width * h ) > (height * w ) then do
- height = ( height * w ) % width
- width = w
- end
- else do
- width = ( width * h ) % height
- height = h
- end
-
- address VISUAL message 'Scaling "'||name||'"...'
-
- Scale width height
- Grey2Color
-
- address VISUAL message 'Rendering "'||name||'"...'
-
- Render Go
-
- SaveRenderedAs ILBM '"'file'.icn"'
-
- Render Close
-
- KillBuffer Force
-
- address
- update
- end
- else do
- address
- unselect
- end
- end
-
- address
-
- Undo On
- Redraw On
-
- /* Quit ImageFX */
- Quit force
-